#include<iostream>
using namespace std;
const int N = 410;
int month[13] = { 0,31,28,31,30,31,30,31,31,30,31,30,31 };
int arr[N];
int n;
bool check(int x)
{
	if (x % 400 == 0 || x % 4 == 0 && x % 100 != 0)return 1;
	return 0;
}
int main()
{
	cin >> n;
	int d = 0;
	for (int i = 1900; i <= 1900 + n - 1; i++) {
		if (check(i)) {
			month[2] = 29;
		}
		else {
			month[2] = 28;
		}
		for (int j = 1; j <= 12; j++) {
			for (int k = 1; k <= month[j]; k++) {
				d++;
				if (d == 8)d = 1;
				if (k == 13) {
					arr[d]++;
				}
			}
		}
	}
	cout << arr[6] << " " << arr[7] << " ";
	for (int i = 1; i <= 5; i++) {
		cout << arr[i] << " ";
	}
	return 0;
}